package com.udi.project.business.activate.controller;


import com.udi.project.business.activate.service.ActivateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Admin
 * 产品激活码认证
 */
@Controller
@RequestMapping("/activate")
public class ActivateCodeController {

    @Autowired
    private ActivateCodeService activateCodeService;



    /**
    *
     * @Description: 产品激活
     * @param code 激活码
     * @param key 公钥或私钥
     * @param type 密钥类型
     * @return: java.lang.String
     * @Date: 2021/8/24 11:45
     *
     * http://localhost:8080/activate/code
     */
    @RequestMapping("/code")
    @ResponseBody
    public String activate(String code,String key,String type){
        String ims = null;
        try {
            String str1 = "U1G6LPBhWGTH+dQFEX1PybBu+KwcUTZsVxA4+cKtV/IKrB5kS3hmLrFIBkPg2iBlLp5asCeieCEnTM+XyytMXW02govQ9uzhsJkkdXZua1AWCwg3feFZVWUJ+kMc4CE3Vf50OI2V853rH8MiwMnwjXaINt5ZxfbCOfqkmnrTtAM=";

            String str2 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCaGn5+Yq9o7kxmDS2zwIREIEkcpKbx44uPT/PX22XOjgzkMvbCEamu7KyatNhkrrSH6E14l1F739WztXffJ/OCXUmgF4egMedyGCA8ymZWbzyhwnZcywa8me8S2rjb3gkCD6VFq8BSPJx9vaMvlR7eZxe1O5lllaV6tE6SlNY7QIDAQAB";

            String str3 = "publicKey";

            ims = activateCodeService.certification(code,key,type);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ims;
    }
}
